Smile is attachable. Every Smile object, each window, each dialog, the application itself, has a script (possibly empty). Many functionalities of Smile are handled by these scripts.
From Smile, or from another application - provided Smile is running - you can call the handlers contained in these scripts. We list below the most useful of them.
Display commands
• FatalAlert(theString)
Displays, in an alert box, the string stored in theString.
• AskUser(thePrompt,theDefaultReply)
Asks the user to provide a string, and returns this string. The user is prompted by the string stored in thePrompt. The dialog box displays the string stored in theDefaultReply as the default reply. If the user cancels, the routine sends the error "User canceled".
• dd(theString)
Displays, in an dialog box, the string stored in theString.
• msg(theString)
Appends, at the end of the Worksheet, the string stored in theString, followed by a carriage return. If the Worksheet is not opened, it will first be opened in a new window.
List utility
• sort(theList)
Assuming that theList is a list of numbers, returns the list sorted by increasing values.